wx.ready(function () {
    wx.showOptionMenu();
    var shareObjtofriends = {
        title: werisiteshare.title,
        desc: werisiteshare.desc,
        link: werisiteshare.link,
        imgUrl: werisiteshare.imgUrl,
        trigger: function (res) {
        },
        success: function (res) {
            $.get(werisiteshare.successtoshare + "&sharetype=tofriends", function(data){
                $.Dialog.success(data);
            })
        },
        cancel: function (res) {

        },
        fail: function (res) {
//            alert(JSON.stringify(res));
        }
    };
    var shareObjtofriend = {
        title: werisiteshare.title,
        desc: werisiteshare.desc,
        link: werisiteshare.link,
        imgUrl: werisiteshare.imgUrl,
        trigger: function (res) {
        },
        success: function (res) {
            $.get(werisiteshare.successtoshare + "&sharetype=tofriend", function(data){
                $.Dialog.success(data);
            })
        },
        cancel: function (res) {

        },
        fail: function (res) {
//            alert(JSON.stringify(res));
        }
    };
    //分享朋友
    wx.onMenuShareAppMessage(shareObjtofriend);
    //分享朋友圈
    wx.onMenuShareTimeline(shareObjtofriends);
});